{include file="common/header"/}
<div class="lemo-container">
    <div class="lemo-main">
        <fieldset class="layui-elem-field layui-field-title">
            <legend>环节{:lang('list')}</legend>
            {if $topic == null}
            <blockquote class="layui-elem-quote">
                暂未选择毕设题目
            </blockquote>
            {else /}
            <blockquote class="layui-elem-quote">
                <div>
                    <p>选择题目：{$topic.title}</p>
                    <p style="margin-top: 10px">题目描述：{$topic.desc}</p>
                    <p style="margin-top: 10px">总分：{$user.grade}</p>
                    <p style="margin-top: 10px">总体评价：{$user.evaluate}</p>
                </div>
            </blockquote>
            {/if}

        </fieldset>

        <table class="layui-table" id="list" lay-filter="list"></table>
    </div>
</div>


<script type="text/html" id="action">
    <a data-href="{:url('edit')}?id={{d.id}}" class="layui-btn  layui-btn-xs" lay-event="edit">{:lang('edit')}</a>
    <!--    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">{:lang('del')}</a>-->

    {{# if(d.file == null || d.file == ''){ }}

    {{# }else{  }}
    <a href="{:url('head_upload')}?file_name={{d.file}}&id={{d.id}}"
       class="layui-btn layui-btn-xs layui-btn-warm">下载文档</a>
    {{# } }}

    <!--    <a data-href="{:url('download')}?id={{d.id}}" class="layui-btn layui-btn-xs layui-btn-warm" lay-event="download">下载文档</a>-->
</script>

<script type="text/html" id="last_login">
    {{layui.util.toDateString(d.last_login*1000, 'yyyy-MM-dd HH:mm:ss')}}
</script>
<script type="text/html" id="create_time">
    {{layui.util.toDateString(d.create_time*1000, 'yyyy-MM-dd HH:mm:ss')}}
</script>
<!--<script type="text/html" id="update_time">-->
<!--    {{layui.util.toDateString(d.update_time*1000, 'yyyy-MM-dd HH:mm:ss')}}-->
<!--</script>-->

<script type="text/html" id="toolbar">
    <div class="layui-btn-container">
        <!--        <button class="layui-btn layui-btn-sm" lay-event="getCheckData">获取选中行数据</button>-->
        <!--        <button class="layui-btn layui-btn-sm" lay-event="getCheckLength">获取选中数目</button>-->
        <!--        <button class="layui-btn layui-btn-sm" lay-event="isAll">验证是否全选</button>-->
    </div>
</script>
{include file="common/footer"/}
<script>
    var tableIn = null;
    layui.config({
        base: "/static/admin/js/",
        version: true
    }).extend({
        Admin: 'Admin',
    }).use(['table', 'Admin'], function () {
        var $ = layui.jquery,
            table = layui.table;

        tableIn = table.render({
            elem: '#list',
            url: '{:url("index")}',
            method: 'post',
            title: '环节数据表',
            toolbar: '#toolbar', //开启头部工具栏，并为其绑定左侧模板

            defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义，去除该参数即可
                title: '提示'
                , layEvent: 'LAYTABLE_TIPS'
                , icon: 'layui-icon-tips'
            }],
            cols: [[
                // {checkbox: true, fixed: true},
                {field: 'id', title: 'ID', width: 80, type: 'numbers', fixed: true, sort: true},
                {field: 'title', title: '标题', width: 200},
                {field: 'feelings', title: '心得体会', width: 400},
                {field: 'grade', title: '分数', width: 100, align: "center"},
                {
                    field: 'grade', title: '文档成绩', width: 100, align: "center", templet: function (e) {
                        if (e.file_grade == 1) {
                            return '合格';
                        } else if (e.file_grade == 2) {
                            return '不合格';
                        } else {
                            return '待评价';
                        }
                    }
                },
                {
                    field: 'file', title: '上传文档', width: 100, align: "center", templet: function (e) {
                        if (e.file == null || e.file == '') {
                            return '未上传';
                        } else {
                            return '已上传';
                        }
                    }
                },
                {field: 'create_time', title: '创建时间', width: 180, templet: '#create_time'},
                // {field: 'update_time', title: '更新时间', width: 180, templet: '#update_time'},

                {title: '操作', width: 200, toolbar: '#action'},

            ]],
            limits: [10, 15, 20, 25, 50, 100],
            limit: 15,
            page: true
        });

    });


</script>